home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / dlgbased.pxl < prev    next >
Text File  |  2000-04-03  |  4KB  |  122 lines

  1. {    Filename    :     dlgbased.pxl
  2.      Purpose    :    Demonstrate buttons and edit controls are used in client area
  3.     Date        :    March 31, 2000
  4.     Author        :    Stewart DIBBS, VYSOR
  5. History:
  6.  
  7.     Version    :  4.40    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL Dialog-Style Application"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,20,174,627,496,Res)                
  24.     UseBackground(TRANSPARENT,192,192,192)     
  25.     WinShow(Title$,TOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     InfoMenu(REMOVE)
  30.     WaitInput(100)
  31.     SetMenu()
  32.  
  33.     StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  34.     DrawStatusWinText(0,"Ready")
  35.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  36.  
  37.  
  38. MakeEditControls:
  39.     Drawbackground
  40.     UseFont("Arial",7,17,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  41.     {WaitInput(100) let windows catch up...common with Button}
  42.     Edit$ = "124"  
  43.     EditM$ = "more blah"  
  44.     Num1$ = "196"
  45.     Num2$ = "199"
  46.     SetEditControl(10, 30,125, 55,STRING,0,0,EditM$,
  47.                    10, 60,125, 85,NUMBER,10,-10,Num1$,
  48.                    10, 90,100, 115,NUMBERUD,100,0,Edit$,
  49.                    10,120,100,145,NUMBERUD,-10,-100,Num2$,
  50.                    10,150,125,175,STRING,0,0,EditM$)
  51.  
  52.     Cbox1$ = "ComboBox#1"
  53.     Cbox2$ = "ComboBox#2"
  54.     Cbox3$ = "ComboBox#3"
  55.     Delimiter$ = "|"
  56.     List1$ = "CBarg#1|CBarg#2|CBarg#3|CBarg#4|CBarg#5|CBarg#6|CBarg#7|CBarg#8"
  57.  
  58.     List2$ = "CBarg#1|CBarg#2|CBarg#3|CBarg#4|"
  59.  
  60.     ComboBox(185,120,300,255,DROPDOWN, List1$,Delimiter$,Cbox1$,
  61.         310,120,425,255,DROPDOWNLIST, List2$,Delimiter$,Cbox2$,
  62.         435,120,550,255,SIMPLE,List1$, Delimiter$,CBox3$)
  63.  
  64.     
  65.     Button(240, 10,340, 40,PUSH,"&Btn1",EndMakeEdit,
  66.         240,50,340,80,PUSH,"&Help",Concept,
  67.         360,50,460,80,PUSH,"&Done",EndMakeEdit,
  68.                    5,10,170,190,GROUP,"Edit Control Styles",EndMakeEdit,
  69.         175,95,560,260,GROUP,"Dropdown ------- DropdownList ------ Simple Style",EndMakeEdit)
  70.  
  71.     UseFont("Arial",11,23,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  72.     DrawShadowText(200,160,"Combobox Styles",255,255,255,1)
  73.     UseFont("Arial",7,17,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  74.     Image$ = SourceDir$ + "\bitmap.bmp"
  75.     DrawSizedBitmap(45,200,150,260,Image$)
  76.     Goto Wait_for_Input
  77.  
  78. EndMakeEdit:
  79.     DrawBackground {now restore the buttons was still want}
  80.     SetEditControl()
  81.     Button(    360,50,460,80,PUSH,"&Exit",Terminate,
  82.         175,95,560,260,GROUP,"Dropdown ------- DropdownList ------ Simple Style",EndMakeEdit)
  83.     UseFont("Arial",7,17,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  84.     WaitInput(1)
  85.     DrawText(10,10,Edit$)
  86.     DrawText(10,35,Num1$)
  87.     DrawText(10,60,EditM$)
  88.     DrawText(10,85,Num2$)
  89.     Goto Wait_for_Input
  90.     
  91.         
  92.  
  93.     
  94. Wait_for_Input:
  95.     WaitInput()
  96.  
  97. Terminate:
  98.     End
  99.  
  100.  
  101. Concept:
  102.     MessageBox(OK,1,INFORMATION,
  103. "A PiXCL application is often better presented to the user as a 
  104. dialog based program with edit controls, comboboxes, push buttons, 
  105. radio buttons, check boxes and group boxes. This program shows
  106. how the controls might be used.  
  107.  
  108. See also the DialogBox command and the Helper applications for details 
  109. on constructing custom dialogs boxes.",
  110.     "PiXCL Dialog Style Applications",Res)
  111.  
  112.     Goto Wait_for_Input
  113.  
  114. About:
  115.     AboutUser("PiXCL Dialog-Style Application",  { or substitute Title$}
  116.       "Two lines of text goes here e.g. Application function.",
  117.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  118.  
  119.     Goto Wait_for_Input
  120.  
  121.  
  122.